﻿<UserControl x:Class="XamlaApp.Views.ElementViews.ImageView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid>
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="VisualStateGroup">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Selected">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="btnLoadImage" Storyboard.TargetProperty="(UIElement.Visibility)">
                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Button Style="{StaticResource xamla_element_editbutton}" Content="Change..." x:Name="btnLoadImage" Visibility="Collapsed"></Button>
        <Image  CacheMode="BitmapCache"
        Width="{Binding Width}"
        Height="{Binding Height}"
        Opacity="{Binding Opacity}"
        Source="{Binding ImageSource}"
        Stretch="{Binding ImageStretch}">
            <Image.Projection>
                <PlaneProjection x:Name="projImage"></PlaneProjection>
            </Image.Projection>
        </Image>
    </Grid>
</UserControl>
